var t = getApp(), a = require("../../../utils/util.js");

t.globalData.url;

Page({
    data: {
        nonce_str: "",
        consume: "",
        couponTotal: "",
        pay_sum: ""
    },
    onLoad: function(t) {
        this.getOrderInfo(t.orderId), 0 == t.status ? wx.setNavigationBarTitle({
            title: "支付失败"
        }) : wx.setNavigationBarTitle({
            title: "支付成功"
        }), this.setData({
            status: t.status,
            nonce_str: t.orderId
        });
    },
    linkIndexPage: function() {
        wx.switchTab({
            url: "../index"
        });
    },
    getOrderInfo: function(e) {
        var n = this, o = t.globalData.token;
        a.request(t, "wx/cust/getOneByServiceOrderId", "POST", {
            serviceOrderId: e,
            token: o
        }, function(t) {
            n.setData({
                discountPrice: null == t.data.discountPrice ? 0 : a.convertMath(t.data.discountPrice),
                debateAmount: a.convertMath(t.data.debateAmount),
                payAmount: null == t.data.payAmount ? 0 : a.convertMath(t.data.payAmount)
            });
        }, function(t) {});
    }
});